package com.ruoyi.prod.entity.query;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.prod.enums.SysAction;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;

/**
 * 基础查询
 * @author BaiBan
 * @since 2023/2/17
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BaseCondition {
    /**
     * 查询开始时间
     */
    @ApiModelProperty(value = "查询开始时间", name = "startDate", example = "查询开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false)
    private LocalDate startDate;

    /**
     * 查询结束时间
     */
    @ApiModelProperty(value = "查询结束时间", name = "endDate", example = "查询结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false)
    private LocalDate endDate;

    /**
     * 当前页
     */
    @ApiModelProperty(value = "当前页", name = "pageNum", required = true, hidden = true)
    @TableField(exist = false)
    private int pageNum = 1;

    /**
     * 每页的数量
     */
    @ApiModelProperty(value = "每页的数量", name = "pageSize", required = true, hidden = true)
    @TableField(exist = false)
    private int pageSize = 10;

    /**
     * 操作事件
     */
    @ApiModelProperty(value = "操作事件", name = "action", required = true, hidden = true)
    @TableField(exist = false)
    private SysAction action;

    /**
     * 记录内容
     */
    @ApiModelProperty(value = "记录内容", name = "content", required = true, hidden = true)
    @TableField(exist = false)
    private String message;
}
